<?php
global $php;

if (isset($php->config['redis'][$php->factory_key])) 
{
	$config = $php->config['redis'][$php->factory_key];
	
	if (empty($config['port']))
		$config['port'] = 6379;
	
	if (empty($config['pconnect']))
		$config['pconnect'] = false;
	
	if (empty($config['timeout']))
		$config['timeout'] = 0.5;
	
	return new Tiger\Component\Redis($config);
}
else 
{
	throw new Exception('require redis[' . $php->factory_key . '] config.');
}

